create table jms_dm.dm_cusc_customer_abnormal_flow_summary_dt
(
    customer_code         varchar(100) comment '客户编码',
    end_virt_code         varchar(100) comment '目的网点(代理区)虚拟代理区',
    order_source_code     varchar(100) comment '订单来源code',
    customer_id           varchar(100) comment '客户id',
    customer_name         varchar(100) comment '客户名称',
    customer_network_code varchar(100) comment '客户所属网点code',
    customer_network_name varchar(100) comment '客户所属网点name',
    customer_fran_code    varchar(100) comment '客户所属加盟商code',
    customer_fran_name    varchar(100) comment '客户所属加盟商name',
    customer_agent_code   varchar(100) comment '客户所属代理区code',
    customer_agent_name   varchar(100) comment '客户所属代理区name',
    order_source_name     varchar(100) comment '订单来源名称 ',
    end_virt_name         varchar(100) comment '目的网点(代理区)虚拟代理区',
    no_taketimely_num     int comment '未及时揽收量',
    no_collect_num        int comment '不准点交件票量',
    false_taking_num      int comment '虚假揽收量',
    no_outtimely_num      int comment '出港不及时量',
    no_signtimely_num     int comment '未及时签收量',
    complaint_num         int comment '客诉量',
    sign_difftime_num     int comment '超24小时揽签量',
    problem_num           int comment '问题件量',
    lose_problem_num      int comment '问题件遗失量',
    worn_problem_num      int comment '问题件破损量',
    pollute_problem_num   int comment '问题件被污染量',
    other_problem_num     int comment '问题件其他量',
    abn_total             int comment '异常总量',
    date_time             date comment '日期'
) ENGINE = OLAP DUPLICATE KEY(customer_code, end_virt_code )
comment '智兔app-客户异动流向汇总'
PARTITION BY RANGE(date_time)
(START ("2023-07-01") END ("2023-08-20") EVERY (INTERVAL 1 day)
)
DISTRIBUTED BY HASH(order_source_code) BUCKETS 1
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-180",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "1",
"in_memory" = "false",
"storage_format" = "V2"
);

